<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>角色管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			layer.load(1, {
			    shade: [0.3,'#000'] //0.1透明度的白色背景
			});
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs nav-tabss">
		<li class="active"><a href="${ctx}/system/role/">角色列表</a></li>
		<shiro:hasPermission name="system:role:edit"><li><a href="${ctx}/system/role/form">角色添加</a></li></shiro:hasPermission>
	</ul>
	
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<tr><th>角色名称</th><th>英文名称</th><th>操作时间</th><shiro:hasPermission name="system:role:edit"><th>操作</th></shiro:hasPermission></tr>
		<c:forEach items="${page.list}" var="role">
			<tr>
				<td><a href="${ctx}/system/role/form?id=${role.id}">${role.name}</a></td>
				<td><a href="${ctx}/system/role/form?id=${role.id}">${role.enname}</a></td>
				<td><fmt:formatDate value="${role.updateTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<shiro:hasPermission name="system:role:edit"><td>
					<c:if test="${(role.sysData eq fns:getDictValue('是', 'yes_no', '1') && fns:getUser().admin)||!(role.sysData eq fns:getDictValue('是', 'yes_no', '1'))}">
						<a href="${ctx}/system/role/form?id=${role.id}">修改</a>
					</c:if>
					<a href="${ctx}/system/role/delete?id=${role.id}" onclick="return confirmx('确认要删除该角色吗？', this.href)">删除</a>
				</td></shiro:hasPermission>	
			</tr>
		</c:forEach>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
